<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/hdiv-spring.tld" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>

<c:url value="mostrarHWF1007.html" var="configArchivosIndicadores"/>

    <script type="text/javascript" language="JavaScript" src="javascript/HMF1007.js"></script>
    <script type="text/javascript">
    
    $(document).ready(function(){ 
        
        $('span.pagelinks>a, table#dispTable>thead>tr>th>a').live('click', function(){
            $.get($(this).attr('href'), function(responseText, status, xmlHttpRequest){
                $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
                }
            );            
            return false;
        });
       /*****************************************************************/
     
        $.getJSON("<c:url value='mostrarHWF1007.html'/>", {accion : "searchDesCliente" },function(data){
            $("#cliente").autocomplete({source:data,
                                        open: function(event,ui){
                                              $("#estado").css('display','none');
                                              },
                                        close: function(event,ui){
                                               $("#estado").css('display','block');
                                              }
                                       });
        });   
        $("#cliente").bestupper({
            clear:false
        });
     
     });
        
        function mostrar(){
            show_loading();
            $.get("<c:url value='mostrarHWF1007.html'/>",{accion:"mostrarClientes",cliente:$('#cliente').val(),estado:$('#estado').val()}, function(responseText, status, xmlHttpRequest){
                $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
                document.getElementById('loading_mostrar').style.display = 'none';  
            });     
        }
        
        function cursor_wait() {
          document.body.style.cursor = 'wait';
        }
        
        function show_loading(){  
            var loadingAnim = document.getElementById('loading_mostrar');  
            loadingAnim.innerHTML = '<img src="imagenes/logoProcesandoRight.gif" width=' + xx_r + 'height=' + yy_r + 'alt="Procesando" />';  
            loadingAnim.style.display = 'block';      
        }
        
        function editarConfigReportes(codClie){
             childWindowTipoArch=window.showModalDialog('<c:url value="mostrarHWF1007.html" />&accion=mostrarEditarReportes&cliente='+ codClie,'selecTipoArch',"dialogWidth:500px;dialogHeight:420px");
             
                show_loading();
                $.get("<c:url value='mostrarHWF1007.html'/>",{accion:"mostrarClientes",cliente:$('#cliente').val(),estado:$('#estado').val()}, function(responseText, status, xmlHttpRequest){
                    $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
                    document.getElementById('loading_mostrar').style.display = 'none';  
                });  
             
        }
        
    </script>

<style type="text/css">  
<!-- 
#loading_mostrar {display:none;}  
-->  
</style> 

<form:form modelAttribute="form" action="${configArchivosIndicadores}">

<!--Favoritos:-->
<input type="hidden" id="codOpci" value="${codOpci}"/>
<input type="hidden" id="desOpci" value="${desOpci}"/>

<table id="fullheighttable" width="775" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="left" valign="top" class="fondo_contenido padtop16left21">
      <table border="0" cellspacing="0" cellpadding="0" class="verdana11bazul">
      <tr>
        <td height="22" align="left" valign="top" class="verdana11bazul">
		<ul class="navlist2">
		<li>CONFIGURACION DE ARCHIVOS INDICADORES </li>
		</ul>
        </td>
         <td width = "150"></td>
       <td> <a href="#" id="opener_agregarFavoritos"> <img src="images/agregar_favoritos.png" width="25" height="23" border="0" title='Agregar Favoritos'/> </a></td>
       
      </tr>
      <tr>
        <td align="center" valign="middle" class="borde_totalblanco">
        
        <table border="0" cellspacing="0" cellpadding="5">
           
          <tr>
            <td height="34" width="60" align="left" valign="middle" class="verdana10bazul">
                Cliente</td>
            <td height="15" align="left" valign="middle" class="verdana10negro">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td align="left" valign="middle" class="padright10"><div class="fondo_txtbox258">
                        &nbsp;<form:input path="cliente" size="45" readonly="false"/>
                      </div></td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
            </td>
          </tr> 
          <tr>
            <td height="34" width="60" align="left" valign="middle" class="verdana10bazul">
                Estado</td>
            <td height="15" align="left" valign="middle" class="verdana10negro">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td align="left" valign="middle" class="padright10">
                        <form:select path="estado">
                            <form:option value="-1">TODOS</form:option>
                            <form:option value="0">INACTIVO</form:option>
                            <form:option value="1">ACTIVO</form:option>
                        </form:select>
                      </td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
            </td>
            <td>
                <input name="Submit2" type="button" class="boton" value="Mostrar" onclick="javascript:mostrar();">
            </td>
          </tr>
        </table>
        </td>
      </tr>
      </table>
      <table border="0" cellpadding="0" cellspacing="0" class="margintop20" width="98%">
        <tr>
                <td colspan="2" align="center">    
                <div id="loading_mostrar"><img id="logoRight" src="imagenes/logoProcesandoRight.gif" alt="Procesando" /></div>  
                </td>
        </tr>
        <tr >
          <td>
            <div id="displayTagDiv">
              <display:table id="configArchInd" name="listaConfigArchInd" cellpadding="0"
                             cellspacing="0" style="width:100%" pagesize="10"
                             export = "false"
                             requestURI="${configArchivosIndicadores}"
                             class="its">
               <tbody>
                <display:column property="desCliente"
                                headerClass="even" style="width:'76%';" class="even "
                                title="Nombre del Cliente"/>              
                <display:column property="estado"
                                headerClass="even"  style="width:'12%';" class="cellcenter "
                                title="Estado"/>
                <display:column 
                                headerClass="even" style="width:'12%';" class="cellcenter "
                                title="Reportes">
                                <a href="#" onclick="editarConfigReportes(${configArchInd.codCliente});">
                                    Reportes
                                </a>
                </display:column>                
               </tbody>
              </display:table>
            <div>
          </td>
        </tr>
        <tr><td>&nbsp;</td>
        </tr>            
      </table>
   </td>
  </tr>
</table>
</form:form> 